<!DOCTYPE html>
<html lang="en">
<head>
    {% load staticfiles %}

    <!--默认标题-->
    <title>{% block title %}{% endblock %}运维管理平台</title>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!--引用自定义css-->
    <link rel="stylesheet" type="text/css" href="{% static 'configmanager/css/td.css' %}"/>
    <link rel="stylesheet" type="text/css" href="/static/configmanager/css/bgDiv.css"/>


    <!--引用jquery cdn-->
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>

    <!--引用bootstratp css、js-->
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
          integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"
            integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
            crossorigin="anonymous"></script>

    <!--应用font-awesome css-->
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"
          integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
    <link rel="stylesheet" type="text/css" href="/static/configmanager/css/loginstyle.css">

    {#    引用echarts#}
    <script src="https://cdn.bootcss.com/echarts/4.1.0/echarts.min.js"></script>

    {#    引用jquery showloading#}
    <link href="/static/configmanager/css/showLoading.css" rel="stylesheet" media="screen"/>
    <script src="/static/configmanager/js/jquery.showLoading.min.js"></script>

    {#    引用jquery multiselect#}
    <link href="/static/configmanager/css/multi-select.css" media="screen" rel="stylesheet" type="text/css">

    {% block head %}{% endblock %}


</head>
<body id="body">

{% load systemmanager %}
<!--页面导航-->
<div class="container-fluid" style="display: {% block nav %}{% endblock %}">
    <nav class="navbar navbar-static-top navbar-inverse" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse"
                        data-target="#example-navbar-collapse">
                    <span class="sr-only">切换导航</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="/">运维管理平台</a>
            </div>
            <div class="collapse navbar-collapse" id="example-navbar-collapse">
                <ul class="nav navbar-nav">
                    <li class="dropdown"><a href="/index/">首页</a></li>
                    <li class="dropdown
















                            {% if request.user.is_superuser or request.user|has_group:'admin' or request.user|has_group:'运维工程师' or request.user|has_group:'运维经理' %}{% else %}disabled{% endif %}">
                        <a href="#"
                           class="dropdown-toggle
















                                   {% if request.user.is_superuser or request.user|has_group:'admin' or request.user|has_group:'运维工程师' or request.user|has_group:'运维经理' %}{% else %}disabled{% endif %}"
                           data-toggle="dropdown">
                            系统管理 <b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu">
                            <li role="presentation" class="dropdown-header">ECS管理</li>
                            <li><a href="{% url 'configmanager:ecslist' %}">ECS列表</a></li>
                            <li role="presentation" class="divider"></li>
                            <li role="presentation" class="dropdown-header">应用管理</li>
                            <li><a href="{% url 'configmanager:sitelist' %}">应用列表</a></li>
                            <li><a href="{% url 'configmanager:siteadd' %}">添加应用</a></li>
                            <li role="presentation" class="divider"></li>
                            <li role="presentation" class="dropdown-header">应用族管理</li>
                            <li><a href="{% url 'configmanager:racelist' %}">应用族列表</a></li>
                            <li role="presentation" class="divider"></li>
                            <li role="presentation" class="dropdown-header">SLB管理</li>
                            <li><a href="{% url 'configmanager:slblist' %}">SLB列表</a></li>
                        </ul>
                    </li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            发布管理 <b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu">
                            <li role="presentation" class="dropdown-header">配置管理</li>
                            <li class="

                                    {% if request.user.is_superuser or request.user|has_group:'admin' or request.user|has_group:'运维工程师' or request.user|has_group:'运维经理' %}{% else %}disabled{% endif %}">
                                <a href="{% url 'configmanager:configlist' %}">配置修改</a></li>
                            <li class="

                                    {% if request.user.is_superuser or request.user|has_group:'admin' or request.user|has_group:'运维工程师' or request.user|has_group:'运维经理' %}{% else %}disabled{% endif %}">
                                <a href="{% url 'configmanager:undeployconfiglist' %}">待生效配置</a></li>
                            <li role="presentation" class="divider"></li>
                            <li role="presentation" class="dropdown-header">发布申请</li>
                            <li><a href="{% url 'configmanager:undeployapplylist' %}">待发布申请</a></li>
                            <li><a href="{% url 'configmanager:applylist' %}">发布申请列表</a></li>
                            <li><a href="{% url 'configmanager:applyadd' %}">创建发布申请</a></li>
                            <li role="presentation" class="divider"></li>
                            <li role="presentation" class="dropdown-header">Jenkins管理</li>
                            <li><a href="{% url 'configmanager:jenkins_job_list' %}">Jenkins任务列表</a></li>
                        </ul>
                    </li>
                    <li class="dropdown"><a href="{% url 'configmanager:alarm_history_list' %}">报警管理</a></li>
                    <li class="dropdown"><a
                            style="{% if request.user.is_staff or request.user|has_group:'admin' %}disploy:;{% else %}display:none;{% endif %}"
                            href="/admin/">后台管理</a></li>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    <li>
                        <a href="#"><span class="glyphicon glyphicon-user"></span> 欢迎！
                            {% if not request.user.first_name %}{{ request.user.username }}{% else %}
                                {{ request.user.first_name }}{% endif %}</a>
                    </li>
                    <li>
                        <a href="{% url 'logout' %}" target="_top"><span class="glyphicon glyphicon-log-out"></span> 注销</a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>
</div>

<!--页面遮盖层-->
{#<div id="bgDiv"></div>#}

<!--页面主体-->
<div class="container-fluid" id="myspin">

    <!--页面提示信息-->
    <div {% if messages %}style="display:;" {% else %}style="display:none;" {% endif %} id="alert-div"
         class="alert alert-info">
        <button type="button" class="close" data-dismiss="alert"
                aria-hidden="true">
            &times;
        </button>
        {% if messages %}
            {% for message in messages %}
                {% autoescape off %}
                    {{ message }}
                {% endautoescape %}
            {% endfor %}
        {% endif %}
    </div>

    <!--搜索栏-->
    <div style="display:{% block search_display %}{% endblock %}" class="container-fluid">
        <form class="navbar-form navbar-left" role="search" method="get">
            <div class="form-group">
                <input type="text" size="40" class="form-control" placeholder="{% block search_notice %}{% endblock %}"
                       name="q">
            </div>
            <button type="submit" class="btn btn-default">搜索</button>
        </form>
    </div>
    <br>

    <!-- content -->
    {% block content %}
    {% endblock %}
    <!-- // content -->

    <!--分页栏-->
    <div class="container-fluid table-responsive">
        {% if is_paginated %}
            <ul class="pagination">
                <li>
                    <span>共有 {{ page_obj.paginator.count }} 条记录</span>&nbsp;&nbsp;
                    <span>Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}</span>
                </li>
                {% if page_obj.has_previous %}
                    <li><a href="?q={{ q }}&page={{ page_obj.previous_page_number }}">上一页</a></li>
                {% else %}
                    <li class="disabled"><span>上一页</span></li>
                {% endif %}
                {% for i in paginator.page_range %}
                    {% if page_obj.number == i %}
                        <li class="active"><span>{{ i }} <span class="sr-only">(current)</span></span></li>
                    {% else %}
                        <li><a href="?q={{ q }}&page={{ i }}">{{ i }}</a></li>
                    {% endif %}
                {% endfor %}
                {% if page_obj.has_next %}
                    <li><a href="?q={{ q }}&page={{ page_obj.next_page_number }}">下一页</a></li>
                {% else %}
                    <li class="disabled"><span>下一页</span></li>
                {% endif %}
            </ul>
        {% endif %}
    </div>

</div>

</body>
</html>
